import { FormSchema } from '/@/components/Form';
import { uploadApi } from '/@/api/sys/upload';

export const formSchema: FormSchema[] = [
  {
    field: 'picUrlList',
    component: 'Upload',
    label: '轮播图',
    colProps: {
      span: 24,
    },
    rules: [{ required: true, message: '请选择上传文件' }],
    componentProps: {
      api: uploadApi,
      maxNumber: 9,
      multiple: true,
      accept: ['image/*'],
      uploadParams: {
        videoFlag: false,
      },
    },
  },
  {
    field: 'videoUrl',
    component: 'Upload',
    label: '视频',
    colProps: {
      span: 24,
    },
    rules: [{ required: true, message: '请选择上视频' }],
    componentProps: {
      api: uploadApi,
      maxNumber: 1,
      multiple: false,
      maxSize: 20,
      accept: ['video/*'],
      uploadParams: {
        videoFlag: true,
      },
    },
  },
];
